-- GENERATED SPELL FOR [Anubisath Warder] --


function spell0_15311(pUnit, Event) --@Dust Cloud,Self--
pUnit:FullCastSpellOnTarget(26072,pUnit)
pUnit:RegisterEvent('Sorts_15311', 13500, 1)
end

function spell1_15311(pUnit, Event) --@Entangling Roots,n/a--
pUnit:FullCastSpellOnTarget(26071,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15311', 16500, 1)
end

function spell2_15311(pUnit, Event) --@Fear,Self--
pUnit:FullCastSpellOnTarget(26070,pUnit)
pUnit:RegisterEvent('Sorts_15311', 9500, 1)
end

function spell3_15311(pUnit, Event) --@Fire Nova,Self--
pUnit:FullCastSpellOnTarget(26073,pUnit)
pUnit:RegisterEvent('Sorts_15311', 615, 1)
end

function spell4_15311(pUnit, Event) --@Silence,Self--
pUnit:FullCastSpellOnTarget(26069,pUnit)
pUnit:RegisterEvent('Sorts_15311', 11500, 1)
end

function Sorts_15311(pUnit, Event)
local choix_sorts_15311 = math.random(0, 4)
if choix_sorts_15311 == 0 then
pUnit:RegisterEvent('spell0_15311', 1, 1)
end
if choix_sorts_15311 == 1 then
pUnit:RegisterEvent('spell1_15311', 1, 1)
end
if choix_sorts_15311 == 2 then
pUnit:RegisterEvent('spell2_15311', 1, 1)
end
if choix_sorts_15311 == 3 then
pUnit:RegisterEvent('spell3_15311', 1, 1)
end
if choix_sorts_15311 == 4 then
pUnit:RegisterEvent('spell4_15311', 1, 1)
end
end

function mob15311_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15311', math.random(1500, 3000), 1)
end

function mob15311_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15311_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15311_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15311, 1, 'mob15311_Action')
RegisterUnitEvent(15311, 2, 'mob15311_Leave')
RegisterUnitEvent(15311, 3, 'mob15311_Kill')
RegisterUnitEvent(15311, 4, 'mob15311_Die')
